* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    position: relative;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.translation-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #6c757d !important;
    color: #fff !important;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 会话状态指示器 */
.session-info {
    font-size: 0.9rem;
    padding: 5px 10px;
    border-radius: 4px;
    background: #e9ecef;
    color: #495057;
}

/* 错误提示样式 */
.error-info {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.warning-info {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background-color: #f0f4ff;
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    width: 48px;
    height: 48px;
    fill: #667eea;
}

.upload-area p {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

.file-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.language-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.language-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.language-item:hover {
    background-color: #f8f9ff;
    border-color: #667eea;
}

.language-item input[type="checkbox"] {
    margin-right: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.progress-text {
    text-align: center;
    font-weight: 600;
    color: #555;
}

.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.result-info {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-info h3 {
    color: #155724;
    margin-bottom: 10px;
}

.result-info ul {
    list-style: none;
    padding: 0;
}

.result-info li {
    padding: 5px 0;
    border-bottom: 1px solid #c3e6cb;
}

.result-info li:last-child {
    border-bottom: none;
}

footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    main {
        padding: 20px;
    }
    
    .language-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 加载动画 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 翻译日志样式 */
.translation-log-container {
    margin-top: 20px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    background: #e9ecef;
    border-radius: 8px 8px 0 0;
}

.log-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #138496, #117a8b);
    transform: translateY(-2px);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800, #d39e00);
    transform: translateY(-2px);
}

.cache-controls {
    margin: 10px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.translation-log {
    height: 300px;
    overflow-y: auto;
    padding: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.4;
    background: white;
    border-radius: 0 0 8px 8px;
}

.log-entry {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #007bff;
    background: #f8f9ff;
    animation: slideIn 0.3s ease-out;
}

.log-entry.success {
    border-left-color: #28a745;
    background: #f0fff4;
}

.log-entry.error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.log-timestamp {
    color: #6c757d;
    font-size: 12px;
    margin-bottom: 4px;
}

.log-content {
    color: #495057;
}

.log-original {
    font-weight: 600;
    color: #007bff;
}

.log-translated {
    font-weight: 600;
    color: #28a745;
}

.log-language {
    color: #6c757d;
    font-size: 12px;
}

.log-error {
    color: #dc3545;
    font-weight: 600;
    font-size: 13px;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 滚动条样式 */
.translation-log::-webkit-scrollbar {
    width: 8px;
}

.translation-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.translation-log::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.translation-log::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 缓存统计信息样式 */
.cache-stats {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cache-stats h4 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
}

.cache-stats ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.cache-stats li {
    margin: 8px 0;
    padding: 5px 0;
}

.cache-stats .highlight {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 15px;
    font-weight: bold;
}

.performance-note {
    margin: 15px 0 0 0;
    font-style: italic;
    opacity: 0.9;
    font-size: 0.9em;
}

.result-stats {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

/* 会话显示样式 */
.session-section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.session-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.2);
}

.session-info {
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.session-info::before {
    content: '🔗';
    font-size: 16px;
}

/* API链接样式 */
.api-link {
    font-size: 0.9em;
    margin-top: 10px;
    text-align: center;
}

.api-link a {
    color: #007bff;
    text-decoration: none;
}

.api-link a:hover {
    text-decoration: underline;
}